<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/6/15
 * Time: 16:45
 */
class Base{
    protected $start;
    protected $end;
    protected $arr = [];
    protected $count = 0;
    protected $name;

    public function __construct($arr)
    {
        $this->arr = $arr;
       // $this->count = count($arr);
    }

    public function run($function='')
    {
        $this->start = microtime(true);
        $return = $this->$function();
        $this->end = microtime(true);
        var_dump(array_slice($return,0,10));
        $this->echoRunTime();
    }

    protected function echoRunTime()
    {
        echo '<hr>'.$this->name.'：'.($this->end - $this->start);
    }

    
}












